#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>



struct stu
{
	char ch[9];
	int a;
	int b;
	int c;
}a[1000];


int max = -1;

int main()
{
	int ret = 0;
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%s%d%d%d", &a[i].ch, &a[i].a, &a[i].b, &a[i].c);
		int sum = a[i].a + a[i].b + a[i].c;
		if (sum > max)
		{
			max = sum;
		 ret = i;
		}
	}
	printf("%s %d %d %d", a[ret].ch, a[ret].a, a[ret].b, a[ret].c);
	return 0;
}